package master;

import java.awt.Color;
import java.awt.Graphics;


public abstract class ComplexNumberClosure extends ComplexNumber {

	protected ComplexNumber [] complexNumbers;//pointers to variables to act on
	
	public ComplexNumberClosure(ComplexNumber ...complexNumbers ) {
		super(0, 0);
		this.complexNumbers = complexNumbers;
	}
	
	public float getReal(){
		return this.function(complexNumbers).getReal();
	}
	public float getImaginary(){
		return this.function(complexNumbers).getImaginary();
	}
	
	
	/**
	 * Return a complexNumber based on the function
	 * @param c
	 * @return
	 */
	public abstract ComplexNumber function(ComplexNumber ... complexNumbers);
	
	public void draw(Graphics g, int x, int y, float multiplier){
		g.setColor(Color.gray);
		for(ComplexNumber c : complexNumbers)c.draw(g, x, y, multiplier);
		g.setColor(Color.green);
		super.draw(g, x, y, multiplier);
	}
	
}
